home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 21
/
Cream of the Crop 21 (Terry Blount) (October 1996).iso
/
bbs
/
bnkfre11.zip
/
BANK.ZIP
/
BANK.PPS
< prev
next >
Wrap
Text File
|
1996-09-19
|
55KB
|
2,061 lines
; BANK.PPE - Originally Written by JP Palazzolo
; February 25, 1996
; Additional work by Dan Shore
;
; Purpose: To allow a user to "Bank" time and bytes for use
; on a future date. Bank balances controlled by
; entries in the configuration file.
;
; To install:
;
; 1) Edit your CMD.LST file(s) to add this:
;
; Charges Per PPE/MNU File Specification -or-
; Command Sec Minute Use Keystroke Substitution
; ══════════════ ═══ ═════════════════ ═════════════════════════════════
; 1) BANK 5 0 0 C:\PCB\PPE\BANK\BANK.PPE
;
; Note: You may have to change the pathname to the PPE.
; Note: You may have to change the security level of the PPE.
;
;──────────────────────────────────────────────────────────────────────────────
'
' Declare our variables
'
STRING dbfields(8) ' Database fields
STRING gamble_mod(15) ' Gambling modules
STRING hold ' Generic STRING variable
STRING hold2 ' Generic STRING variable
STRING temp ' Generic STRING variable
STRING main_prompt ' Generic prompt for user input
STRING user_input ' Generic user input
STRING bank_inf_file ' BANK????.INF path and name
STRING exchange_value ' User input for exchange
STRING pcb_user_name ' Username
STRING key ' Variable to hold key hit
STRING cfg_sl ' Security Level to match (CFG)
STRING last_date ' Last date user used Bank
STRING wd_byte_date ' Last date of bytes w/d
STRING wd_time_date ' Last date of time w/d
STRING max_dl_bytes ' Password file D/L Byte Limit
INTEGER byte_wd ' bytes withdrawn for day
INTEGER max_byte_wd ' Max bytes user can w/d per day (CFG)
INTEGER bank_bytes ' Current Bank Bytes
INTEGER max_bank_bytes ' Maximum bytes to deposit (CFG)
INTEGER time_wd ' time withdrawn for day
INTEGER max_time_wd ' Max time user can w/d per day (CFG)
INTEGER bank_time ' Current Bank Time
INTEGER max_bank_time ' Maximum time allowed to deposit (CFG)
INTEGER time_exchange_rate ' Exchange rate for giving time
INTEGER byte_exchange_rate ' Exchange rate for giving bytes
INTEGER size ' Generic INTEGER variable
INT x ' Generic INT variable
INT trans_type ' Used for withdraw/deposit error type
' Also used in exchange for bank/online type
DATE inf_date ' Date of BANK????.INF file
TIME inf_time ' Time of BANK????.INF file
BOOLEAN do_withdraw ' Flag for withdraw (not deposit)
BOOLEAN clear_21 ' Flag to clear line 21
BOOLEAN do_time ' Time or Byte action
BOOLEAN use_bank_bal ' Flag to use Bank Balance for exchange
BOOLEAN use_online_bal ' Flag to use online balance for exchange
BOOLEAN ck_ok ' Flag for if user can exchange
'──────────────────────────────────────────────────────────────────────────
'
' Declare our procedures
'
DECLARE PROCEDURE WITHDRAW (BOOLEAN time)
DECLARE PROCEDURE DEPOSIT (BOOLEAN time)
DECLARE PROCEDURE WAIT_FOR_KEY ()
DECLARE PROCEDURE CLEAR_20_21 (BOOLEAN clear_21)
DECLARE PROCEDURE ADD_COMMAS (VAR STRING hold2)
DECLARE PROCEDURE ASK_MAXIMUM (VAR INTEGER int1, INTEGER int2, INTEGER int3, INTEGER int4, INTEGER int5, VAR STRING user_input, VAR STRING hold, INT trans_type)
DECLARE PROCEDURE CHECK_MAX (VAR BOOLEAN ck_ok)
DECLARE FUNCTION GET_CONFIRM () BOOLEAN
*$USEFUNCS
BEGIN
'
' Get info on current user
'
GETUSER
'
' Open node specific Log file
'
FAPPEND 7, PPEPATH() + "NODE" + STRING(PCBNODE()) + ".LOG", O_RW, S_DN
FPUTLN 7, "────────────── " + MIXED(U_NAME()) + " ──────────────"
'
' Open database and index
'
GOSUB OPEN_DATABASE
GOSUB OPEN_INDEX
'
' Find user in database, or add as a new user
'
GOSUB FIND_ADD_USER
'
' Read the PASSWORDS file to get users maximum d/l byte limit
'
GOSUB GET_MAX_DL_BYTES
'
' Clear the screen, read the configuration file
'
CLS
GOSUB READ_CONFIG
'
' Determine our .INF file name and location
'
bank_inf_file = PPEPATH() + "BANK" + STRING(PCBNODE()) + ".INF"
'
' If ANSI, display ANSI MENU
'
IF (ANSION()) GOSUB DISPLAY_MENU
'
' Log user information
'
GOSUB GET_INFO
FPUTLN 7, " Date : ", DATE()
FPUTLN 7, " Time : ", TIME()
FPUTLN 7, "Last Time W/D Date : ", wd_time_date
FPUTLN 7, "Last Byte W/D Date : ", wd_byte_date
'
' Prompt the user for their action
'
GOSUB MENU
'
' Exit the program
'
GOTO EXIT_PROG
END
'────────────────────────────────────────────────────
' Start of Subroutines
'────────────────────────────────────────────────────
'
' Retrieve info from database and post to log
'
:GET_INFO
'
' Get database info
'
bank_time = DGET (7,"banktime")
bank_bytes = DGET (7,"bankbytes")
last_date = DGET (7,"last_d_acc")
wd_byte_date = DGET (7, "bytewddate")
wd_time_date = DGET (7, "timewddate")
byte_wd = DGET (7, "bytewd")
time_wd = DGET (7, "timewd")
'
' If wd date is not todays date, zero out variables
'
IF (wd_byte_date != STRING(DATE())) byte_wd = 0
IF (wd_time_date != STRING(DATE())) time_wd = 0
RETURN
'
' Display maximum bank amounts available to the user
'
:DISPLAY_MAX_BANK_AMOUNTS
'
' ANSI Display
'
IF (ANSION()) THEN
'
' Display Bank Time Information
'
IF (max_bank_time != 0) THEN
'
' Display maximum time balance and max time w/d per day
'
ANSIPOS 21,11
PRINT "@X02", max_bank_time
ANSIPOS 21, 12
PRINT "@X02", max_time_wd
ELSE
ANSIPOS 21,11
PRINT "@X03Insuff. Security"
ANSIPOS 21, 12
PRINT "@X03Insuff. Security"
END IF
'
' Display Bank Byte Information
'
IF (max_bank_bytes != 0) THEN
'
' Display maximum byte balance
'
ANSIPOS 60, 11
size = max_bank_bytes
ADD_COMMAS (hold2)
PRINT "@X02", hold2
'
' Display maximum byte withdraw/day amount
'
ANSIPOS 60, 12
size = max_byte_wd
ADD_COMMAS (hold2)
PRINT "@X02", hold2
ELSE
ANSIPOS 60, 11
PRINT "@X03Insuff. Security"
ANSIPOS 60, 12
PRINT "@X03Insuff. Security"
END IF
ELSE
'
' Non-Ansi display
'
PRINTLN " Maximum Bank Time Allowed: ", max_bank_time
PRINTLN " Maximum Time Withdraw Per Day: ", max_time_wd
'
IF (max_bank_bytes != 0) THEN
PRINTLN " Maximum Bank Bytes Allowed: ", max_bank_bytes
PRINTLN "Maximum Bytes Withdraw Per Day: ", max_byte_wd
ELSE
PRINTLN " Maximum Bank Bytes Allowed: Insuff. Security"
PRINTLN "Maximum Bytes Withdraw Per Day: Insuff. Security"
END IF
'
END IF
RETURN
'
' Find out maximum download bytes available for user
'
:GET_MAX_DL_BYTES
'
' Find password file in PCBOARD.DAT and find matching
' security level. Once found, get the total d/l bytes
' available to the user.
'
' Security level is the 2nd parameter and daily d/l byte limit
' is the 4th parameter.
'
'
hold = RTRIM(READLINE(PCBDAT(),32)," ")
FOPEN 1, hold, O_RD, S_DN
WHILE (1) DO
'
' Read a line from the passwrd file
'
FGET 1, hold2
'
' Check for EOF
'
IF (FERR(1)) BREAK
'
' Replace any commas with semi-colons so we can tokenize string
'
hold2